<form class="form-horizontal" name="host_form" ng-submit="do_migrate()">
    <div class="modal-header">
        <a class="close" ng-click="close()">×</a>

        <h3>{{ title }}</h3>
    </div>
    <div class="modal-body">
        <div class="row-fluid">
            <div class="control-group">
                <label class="control-label">名称：</label>

                <div class="controls">
                    <label class="fieldinline">{{ vm.name }}</label>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">原始主机：</label>

                <div class="controls">
                    <label class="fieldinline">{{ vm.host.host_name }}</label>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">新主机：</label>

                <div class="controls">
                    <select ng-model="migrate.host" ng-options="h.host_name for h in hosts" class="span5">
                        <option value="">自动选择</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">离线迁移：</label>

                <div class="controls">
                    <input type="checkbox" ng-model="migrate.offline"/>
                </div>
            </div>

            <div class="control-group">
                <div class="control-label">
                <i class="icon-arrow-down"></i><a ng-click="hasadvance = !hasadvance">高级</a>
                    </div>
            </div>

            <div ng-show="hasadvance">

                <div class="control-group">
                    <label class="control-label">超时时间</label>

                    <div class="controls">
                        <input type="checkbox" ng-model="timeoutenable"/>
                        <input type="text" ng-required="timeoutenable" class="input-mini" ng-model="migrate.timeout" ng-disabled="!timeoutenable" ng-pattern="/^\d+$/"/> 毫秒
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">带宽</label>

                    <div class="controls">
                        <input type="checkbox" ng-model="bandenable"/>
                        <input type="text" ng-required="bandenable" class="input-mini" ng-model="migrate.bandwidth" ng-disabled="!bandenable"  ng-pattern="/^\d+$/"/> Mbps
                    </div>
                </div>

            </div>

        </div>
    </div>
    <div class="modal-footer">
        <a data-dismiss="modal" class="btn" ng-click="close()">关闭</a>
        <button type="submit" ng-disabled="!host_form.$valid" class="btn btn-primary">保存</button>
    </div>
</form>